<%--
  Created by IntelliJ IDEA.
  User: wang
  Date: 2022/12/17
  Time: 12:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description"
        content="Probably the most complete UI kit out there. Multiple functionalities and controls added,  extended color palette and beautiful typography, designed as its own extended version of Bootstrap at  the highest level of quality.                             ">
  <meta name="author" content="Webpixels">
  <title>管理员登陆</title>
  <!-- Fonts -->
  <link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700,800|Roboto:400,500,700" rel="stylesheet">
  <!-- Theme CSS -->
  <link type="text/css" href="assets/css/theme.css" rel="stylesheet">
  <link type="text/css" href="assets/css/demo.css" rel="stylesheet">
  <%--        使用正则表达式校验用户名和密码的格式,但为了测试方便,暂时注释掉 --%>
<%--  <script>--%>
<%--    window.onload = function () {--%>
<%--      var myTestBtn = document.getElementById("sub")--%>
<%--      var myTestRegex = document.getElementsByClassName("regex")--%>
<%--      var myError = document.getElementsByClassName("error")--%>
<%--      var myusername = "XiaoyangShi"--%>
<%--      var mypwd = "123456"--%>

<%--      myTestBtn.onclick = function () {--%>

<%--        username_value = myTestRegex[0].value;--%>
<%--        pwd_value = myTestRegex[1].value;--%>

  <%--        使用正则表达式校验用户名和密码的格式,但为了测试方便,暂时注释掉 --%>
<%--        var reg_username = /.{6,20}$/--%>
<%--        var reg_pwd = /.{5,15}$/--%>
<%--        if (!reg_username.test(username_value)) {--%>
<%--          alert("账号输入错误，请保证账号在6~20位之间")--%>
<%--          window.event.returnValue = false--%>
<%--          window.location.href = 'login2.html'--%>
<%--          return--%>
<%--        }--%>
<%--        if (!reg_username.test(pwd_value)) {--%>
<%--          alert("密码输入错误，密码在5~15位之间")--%>
<%--          window.event.returnValue = false--%>
<%--          window.location.href = 'login2.html'--%>
<%--          return--%>
<%--        }--%>
<%--        if (username_value != myusername || pwd_value != mypwd) {--%>
<%--          alert("用户名或密码输入错误！请重新输入！提示：我的名字")--%>
<%--          window.event.returnValue = false--%>
<%--          window.location.href = 'login2.html'--%>
<%--          return--%>
<%--        }--%>
<%--        window.event.returnValue = false--%>
<%--        window.location.href = 'manager.html'--%>
<%--      }--%>
<%--    }--%>
<%--  </script>--%>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-transparent navbar-dark bg-dark py-4">
  <div class="container">
    <a class="navbar-brand" href="#"><strong>易物平台</strong></a>
    <button class="navbar-toggler" type="button" data-action="offcanvas-open" data-target="#navbar_main"
            aria-controls="navbar_main" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="navbar-collapse offcanvas-collapse" id="navbar_main">
      <ul class="navbar-nav ml-auto align-items-lg-center">
        <li class="nav-item ">
          <a class="nav-link" href="overview.html">首页</a>
        </li>
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="navbar_main_dropdown_1" role="button"
             data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">选项</a>
          <div class="dropdown-menu" aria-labelledby="navbar_1_dropdown_1">
            <a class="dropdown-item" href="sign-in.html">登录</a>
            <a class="dropdown-item" href="sign-in.html">交易广场</a>
            <a class="dropdown-item" href="sign-in.html">个人中心</a>
            <a class="dropdown-item" href="sign-in.html">管理员中心</a>
          </div>
        </li>
      </ul>
    </div>
  </div>
</nav>
<%--主要部分--%>
<main class="main">
  <section class="py-xl bg-cover bg-size--cover"
           style="background-image: url('assets/images/backgrounds/img-1.jpg')">
    <span class="mask bg-primary alpha-6"></span>
    <div class="container d-flex align-items-center no-padding">
      <div class="col">
        <div class="row justify-content-center">
          <div class="col-lg-4">
            <div class="card bg-primary text-white">
              <div class="card-body">
                <button type="button" class="btn btn-primary btn-nobg btn-zoom--hover mb-5">
                  <span class="btn-inner--icon"><i class="fas fa-arrow-left"></i></span>
                </button>
                <span class="clearfix"></span>
                <img src="assets/images/brand/icon.png" style="width: 50px;">
                <h4 class="heading h3 text-white pt-3 pb-5">欢迎回来，<br>
                  请登录您的账号。</h4>
<%--                                                表单提交路径   AdminLoginController为后端编写的servlet代码 做逻辑上的处理--%>
                <form class="form-primary" action="${pageContext.request.contextPath}/AdminLoginController" method="post">
                  <div class="form-group">
                    <input required="required" type="text" class="regex form-control" placeholder="账号在6~20位之间"
                           id="name" name="name">
                  </div>
                  <div class="form-group">
                    <input required="required" type="password" class="regex form-control" placeholder="密码在5~15位之间"
                           id="password" name="password">
                  </div>
                  <div class="text mt-4">
                    <a href="index.jsp" class="text-white">用户登录</a>
                  </div>
                  <button type="submit" class="btn btn-block btn-lg bg-white mt-4" id="sub">登录</button>
                </form>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
</main>
<!-- Core -->
<script src="assets/vendor/jquery/jquery.min.js"></script>
<script src="assets/vendor/popper/popper.min.js"></script>
<script src="assets/js/bootstrap/bootstrap.min.js"></script>
<!-- FontAwesome 5 -->
<script src="assets/vendor/fontawesome/js/fontawesome-all.min.js" defer></script>
<!-- Page plugins -->
<script src="assets/vendor/bootstrap-select/js/bootstrap-select.min.js"></script>
<script src="assets/vendor/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script>
<script src="assets/vendor/input-mask/input-mask.min.js"></script>
<script src="assets/vendor/nouislider/js/nouislider.min.js"></script>
<script src="assets/vendor/textarea-autosize/textarea-autosize.min.js"></script>
<!-- Theme JS -->
<script src="assets/js/theme.js"></script>
</body>
</html>
